﻿using System.Windows;
using GalaSoft.MvvmLight.Threading;
using MoreEPG.View;
using System.Linq;
using System.Globalization;
using System.Threading;
using System.Windows.Markup;
using System.Runtime.InteropServices;
using System;
using MoreEPG.ViewModel;

namespace MoreEPG
{
    /// <summary>
    /// Interaktionslogik für "App.xaml"
    /// </summary>
    public partial class App : Application
    {
        

        static App()
        {
            DispatcherHelper.Initialize();
        }

        protected override void OnStartup(StartupEventArgs e)
        {
            CultureInfo culture = null;

            // FRENCH
            //
            //culture = new CultureInfo("fr-FR");


            // GERMAN
            //
            culture = new CultureInfo("de-DE");

            //culture = new CultureInfo("en");

            if (culture != null)
            {
                Thread.CurrentThread.CurrentCulture = culture;
                Thread.CurrentThread.CurrentUICulture = culture;
            }

            // Ensure the current culture passed into bindings is the OS culture.
            // By default, WPF uses en-US as the culture, regardless of the system settings.
            FrameworkElement.LanguageProperty.OverrideMetadata(
              typeof(FrameworkElement),
              new FrameworkPropertyMetadata(
                  XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            //if (!HelperClass.isW7)
            //{
            //    CustomDialogBox msgBox = new CustomDialogBox();
            //    msgBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //    CustomDialogBoxViewModel dbVM = msgBox.DataContext as CustomDialogBoxViewModel;
            //    dbVM.customMessageBoxImage = Helper.CustomMessageBoxImage.Error;
            //    dbVM.customMessageBoxButton = Helper.CustomMessageBoxButton.OK;
            //    dbVM.InfoText = "OS is not Windows 7 !\n\n App will close.";
            //    msgBox.ShowDialog();
            //}
            
            base.OnStartup(e);

            
        }

       
    }
}
